//
//  GuiBenDiOneView.m
//  ZhiHuiLiJiang
//
//  Created by Work on 2018/11/18.
//  Copyright © 2018年 王雅鹏. All rights reserved.
//已废弃

#import "GuiBenDiOneView.h"

@implementation GuiBenDiOneView

-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        [self addView];
        self.contentView.backgroundColor = [UIColor whiteColor];
    }
    return self;
}

-(void)addView{
    [self.contentView addSubview:self.HScorll];
    [self.contentView addSubview:self.imageView];
    [self.contentView addSubview:self.titleLabel];
    [self.contentView addSubview:self.Btn];
    [self.contentView addSubview:self.OneImageView];
    [self.contentView addSubview:self.TwoImageView];
    [self.contentView addSubview:self.ThreeImageView];
    [self.contentView addSubview:self.imageViewBottom];
    [self.contentView addSubview:self.StitleLabel];
    [self.contentView addSubview:self.moreBtn];

    [self.HScorll mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mas_left);
        make.top.mas_equalTo(self.mas_top);
        make.size.mas_equalTo(CGSizeMake(KSCREEWIDTH, 130));
        
    }];
    [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mas_left).offset(10);
        make.top.mas_equalTo(self.HScorll.mas_bottom).offset(16);
        make.size.mas_equalTo(CGSizeMake(18, 18));
        
    }];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {    make.left.mas_equalTo(self.imageView.mas_right).offset(10);
        make.centerY.mas_equalTo(self.imageView.mas_centerY);
    }];
    [self.Btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.mas_right).offset(-10);
        make.centerY.mas_equalTo(self.imageView.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(60, 30));
        
    }];
    
    [self.OneImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(9);
        make.left.mas_equalTo(self.mas_left).offset((KSCREEWIDTH - 336)/4);
        make.size.mas_equalTo(CGSizeMake(112, 60));
    }];
    
    [self.TwoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(9);
        make.left.mas_equalTo(self.OneImageView.mas_right).offset((KSCREEWIDTH - 336)/4);
        make.size.mas_equalTo(CGSizeMake(112, 60));
        
    }];
    [self.ThreeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(9);
        make.right.mas_equalTo(self.mas_right).offset(-(KSCREEWIDTH - 336)/4);
        make.size.mas_equalTo(CGSizeMake(112, 60));
        
    }];
    [self.imageViewBottom mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mas_left);
        make.right.mas_equalTo(self.mas_right);
        make.height.mas_equalTo(@4);
        make.top.mas_equalTo(self.ThreeImageView.mas_bottom).offset(18);
    }];
    [self.StitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.imageView.mas_left);
        make.top.mas_equalTo(self.imageViewBottom.mas_bottom).offset(15);
    }];
    [self.moreBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.Btn.mas_right);
        make.centerY.mas_equalTo(self.StitleLabel.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(60, 30));

    }];


    
    
}
-(SDCycleScrollView *)HScorll{
    
    if (!_HScorll) {
        _HScorll = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, 0, 0) delegate:nil placeholderImage:[UIImage imageNamed:@"placeholder"]];
        _HScorll.pageControlAliment = SDCycleScrollViewPageContolAlimentCenter;
        _HScorll.currentPageDotColor = [UIColor whiteColor]; // 自定义分页控件小圆标颜色
        NSArray *imagesURLStrings = @[
                                      @"https://ss2.baidu.com/-vo3dSag_xI4khGko9WTAnF6hhy/super/whfpf%3D425%2C260%2C50/sign=a4b3d7085dee3d6d2293d48b252b5910/0e2442a7d933c89524cd5cd4d51373f0830200ea.jpg",
                                      @"https://ss0.baidu.com/-Po3dSag_xI4khGko9WTAnF6hhy/super/whfpf%3D425%2C260%2C50/sign=a41eb338dd33c895a62bcb3bb72e47c2/5fdf8db1cb134954a2192ccb524e9258d1094a1e.jpg",
                                      @"http://c.hiphotos.baidu.com/image/w%3D400/sign=c2318ff84334970a4773112fa5c8d1c0/b7fd5266d0160924c1fae5ccd60735fae7cd340d.jpg"
                                      ];
        
        _HScorll.imageURLStringsGroup = imagesURLStrings;
        
    }
    return _HScorll;
}

-(UIImageView *)OneImageView{
    if (!_OneImageView) {
        _OneImageView = [[UIImageView alloc]init];
    }
    return _OneImageView;
}
-(UIImageView *)TwoImageView{
    if (!_TwoImageView) {
        _TwoImageView = [[UIImageView alloc]init];
    }
    return _TwoImageView;
}
-(UIImageView *)ThreeImageView{
    if (!_ThreeImageView) {
        _ThreeImageView = [[UIImageView alloc]init];
    }
    return _ThreeImageView;
}

-(UIButton *)Btn{
    if (!_Btn) {
        _Btn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_Btn setTitle:@"查看更多" forState:UIControlStateNormal];
        [_Btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        _Btn.titleLabel.font = H13;
        [_Btn addTarget:self action:@selector(btnclick) forControlEvents:UIControlEventTouchUpInside];
        
    }
    return _Btn;
}
-(UILabel *)imageView{
    if (!_imageView) {
        _imageView = [[UILabel alloc]init];
        _imageView.text = @"热";
        _imageView.textColor  =[UIColor whiteColor];
        _imageView.font = H12;
        _imageView.textAlignment = NSTextAlignmentCenter;
        _imageView.layer.masksToBounds = YES;
        _imageView.layer.cornerRadius = 9;
        _imageView.backgroundColor = RGBA(39, 199, 174, 1);
    }
    return _imageView;
}
-(UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc]init];
        _titleLabel.text = @"热门景点";
        _titleLabel.font = H14;
    }
    return _titleLabel;
}
-(void)btnclick{
    
    if (self.delegate  && [self.delegate respondsToSelector:@selector(DelemoreBtnClick)]) {
        [self.delegate DelemoreBtnClick];
    }
}

-(UIView *)imageViewBottom{
    if (!_imageViewBottom) {
        _imageViewBottom  =[[UIView alloc]init];
        _imageViewBottom.backgroundColor = RGBA(226, 226, 226, 1);
    }
    return _imageViewBottom;
}
-(UILabel *)StitleLabel{
    if (!_StitleLabel) {
        _StitleLabel = [[UILabel alloc]init];
        _StitleLabel.text = @"玩法路线";
        _StitleLabel.font = H14;
    }
    return _StitleLabel;
}

-(UIButton *)moreBtn{
    if (!_moreBtn) {
        _moreBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_moreBtn setTitle:@"查看更多" forState:UIControlStateNormal];
        [_moreBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        _moreBtn.titleLabel.font = H13;
        [_moreBtn addTarget:self action:@selector(moreBtnclick) forControlEvents:UIControlEventTouchUpInside];
        
    }
    return _moreBtn;
}
-(void)moreBtnclick{
    if (self.delegate  && [self.delegate respondsToSelector:@selector(DeleBtnClick)]) {
        [self.delegate DeleBtnClick];
    }

}

@end
